Fixed Actions.
[f432xdd.git] / java / Graph Editor / src / controllers / actions / AddNode.java
blobbf5590c37c29167d933ef618aa11b6231c1107c1
1 package controllers.actions;
3 import javax.swing.undo.AbstractUndoableEdit;
5 import controllers.SelectionController;
7 import models.GraphVertex;
9 public class AddNode extends AbstractUndoableEdit {
10 private static final long serialVersionUID = -7929100929760152271L;
11 private SelectionController selectionController;
12 private GraphVertex o;
16 public AddNode(SelectionController selectionController)
18 this.selectionController = selectionController;
19 o = new GraphVertex();
20 redoAction();
22 private void redoAction(){
23 selectionController.getModel().addGraph(o);
24 selectionController.setSelected(o);
27 public void redo()
29 super.redo();
30 redoAction();
33 public void undo()
35 super.undo();
36 selectionController.getModel().removeGraph(o);
37 selectionController.removeSelected();
40 public boolean isSignificant(){
41 return true;
44 public String getPresentationName(){
45 return "Vertex toevoegen.";